<?php
require_once("connection.php");

$name = $_POST["name"];
$size = $_POST["size"];
$occasion = $_POST['occasion'];
$quantity = $_POST['quantity'];
$color = $_POST['color'];
$price = $_POST['price'];
$address = $_POST['address'];
$add = $_POST["add"];


if(!empty($occasion)){
mysql_query( "UPDATE flowers SET occasion='$occasion' WHERE fname='$name' AND size='$size'"); 
}
if(!empty($quantity)){
mysql_query( "UPDATE flowers SET quantity=$quantity WHERE fname='$name' AND size='$size'"); 
}
if(!empty($color)){
mysql_query( "UPDATE flowers SET color='$color' WHERE fname='$name' AND size='$size'"); 
}
if(!empty($price)){
mysql_query(" UPDATE flowers SET price='$price' WHERE fname='$name' AND size='$size'"); 
}
if(!empty($address)){
mysql_query(" UPDATE flowers SET picture='$address' WHERE fname='$name' AND size='$size'"); 
}
if(!empty($add)){
mysql_query( "UPDATE flowers SET quantity=quantity+$add WHERE fname='$name' AND size='$size'"); 
}
header("location: Admin_flower.php");
   
/*
echo "<table border ='1'>
<tr>
<th>name</th>
<th>occasion</th>
<th>quantity</th>
<th>color</th>
<th>size</th>
<th>price</th>
</tr>";
$result = mysql_query("SELECT * FROM Flowers");
While($row=mysql_fetch_array($result))
{
   echo "<tr>";
  echo "<td>" . $row['fname'] . "</td>";
  echo "<td>" . $row['occasion'] . "</td>";
  echo "<td>" . $row['quantity'] . "</td>";
  echo "<td>" . $row['color'] . "</td>";
   echo "<td>" . $row['size'] . "</td>";
  echo "<td>" . $row['price'] . "</td>";
  echo "</tr>";
}
echo"</table>";
*/
?>
